package com.example.demo.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

@Data
@ApiModel(value = "分页传入参数", description = "分页传入参数")
public class PageParam extends BaseParam {

    @NotNull(message = "页码不能为空")
    @ApiModelProperty(value = "页码", name = "page", required = true, example = "1")
    private int page = 1;

    @NotNull(message = "数量不能为空")
    @ApiModelProperty(value = "数量", name = "size", required = true, example = "20")
    private int size = 20;

    @ApiModelProperty(value = "排序规则（升序asc，降序desc）", name = "direction", required = false, example = "asc")
    private String direction = "asc";

    @ApiModelProperty(value = "排序字段", name = "properties", required = false, example = "insert_time")
    private String properties = "insert_time";
}
